home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / HippoDraw / hippo / hippoplotXIV.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-28  |  4.2 KB  |  171 lines

  1. /*
  2.  * hippoplotXIV.h -  routines for producing X/InterViews displays.
  3.  *
  4.  * Copyright (C)  1991  The Board of Trustees of The Leland Stanford
  5.  * Junior University.  All Rights Reserved.
  6.  *
  7.  * $Header: /nfs/ebnextk/LocalSources/hippo/RCS/hippoplotXIV.h,v 1.4 1992/04/28 22:18:21 rensing Rel $
  8.  *
  9.  * Author          : Tom Pavel
  10.  * Created On      : Thu Mar 21 19:28:14 1991
  11.  * Last Modified By: Tom Pavel
  12.  * Last Modified On: Fri Jan  3 15:55:27 1992
  13.  * Update Count    : 16
  14.  * Status          : Release 1
  15.  */
  16.  
  17.  
  18.  
  19. #ifndef _hippoplotXIV_h_
  20. #define _hippoplotXIV_h_
  21.  
  22. #ifdef __cplusplus
  23. class Canvas;
  24. class Painter;
  25. #else
  26. typedef void Canvas;
  27. typedef void Painter;
  28. #endif
  29.  
  30. #include "hippo.h"    /* For structures and enums... */
  31.  
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37.  
  38. /*
  39.  * initPlot - specify the InterViews Painter and Canvas objects to be used
  40.  * for drawing.  This sets global values that are used by the other routines,
  41.  * so it should be called whenever the information is changed (h_plot).
  42.  */ 
  43. void initPlot_XIV(void* painter, void* canvas);
  44.  
  45. /*
  46.  * setHistoCoords - specify the inner rectangle (margin) in device coords
  47.  * (points), and the inner rectangle again in user coords. This sets global
  48.  * values that are used by the other routines, so it should be called
  49.  * whenever any rectangle specification is changed.  Note that the outer
  50.  * rectangle (drawRect) is determined from the Canvas object, so we don't
  51.  * pass that.
  52.  */
  53. void setHistoCoords_XIV(rectangle* margin, rectangle* data);
  54.  
  55. /*
  56.  * Place text at a given location in device coords. X alignment is
  57.  * specified as 'L', 'R', or 'C' (or lower case), meaning that the
  58.  * left, right, or center of the text is positioned at the xy
  59.  * location.  Similarly Y alignment is given as 'B', 'C', or 'T', for
  60.  * bottom, center or top.  Rotation is then performed, given in
  61.  * degrees anti-clockwise.  The variable 'fontSize' is the size in
  62.  * 'points', which is currently ignored.
  63.  */
  64. void drawText_XIV(char *message,
  65.                   float x,
  66.                   float y,
  67.                   float fontHeight,
  68.                   float angle,
  69.                   char xalign,
  70.                   char yalign);
  71.  
  72. /*
  73.  * plot "x10^mag" at specified location
  74.  */
  75. void drawMag_XIV(float x, float y,
  76.                  int mag,
  77.          float fontsize);
  78.  
  79. /*
  80.  * draw ticks and labels along X axis
  81.  */
  82. void drawXTicks_XIV(float* x,
  83.                     int nt,
  84.                     float tickwidth,
  85.             int side);
  86.  
  87. /*
  88.  * draw ticks and labels along Y axis
  89.  */
  90. void drawYTicks_XIV(float* y,
  91.                     int nt,
  92.                     float tickwidth,
  93.             int side);
  94.  
  95.  
  96. /*
  97.  * draw a rectangle using the supplied device coordinates (points).
  98.  */
  99. void drawRect_XIV(float x, float y,
  100.                   float width, float height);
  101.  
  102. /*
  103.  * draw a filled rectangle using the supplied device coordinates (points).
  104.  * The fill is determined by "grey" (0-1).
  105.  */
  106. void drawFilledRect_XIV(float x, float y,
  107.                         float width, float height,
  108.             float grey);
  109.  
  110. /*
  111.  * draw a shaded rectangle in data coordinates, using a 60% grey.
  112.  */
  113. void shade_XIV(float xlow, float xhigh,
  114.            float ylow, float yhigh );
  115.  
  116. /*
  117.  * Draw lines between coordinates
  118.  */
  119. void drawLine_XIV(float *xy, int nxy,
  120.           linestyle_t ls);
  121.  
  122. /*
  123.  * Draw a series of points, using the symbol specified
  124.  */
  125. void drawPoints_XIV(float xy[],
  126.                     int nxy,
  127.                     int symbol,
  128.                     float symbolsize);
  129.  
  130. /*
  131.  * Draw horizontal error bars.  We use only the y part of the
  132.  * coordinates, plus the x-low and x-high pairs.
  133.  */
  134. void drawXError_XIV(float xy[],
  135.                     float errs[],
  136.                     int npts);
  137.  
  138. /*
  139.  * Draw vertical error bars.  We use only the x part of the
  140.  * coordinates, plus the y-low and y-high pairs.
  141.  */
  142. void drawYError_XIV(float xy[],
  143.                     float errs[],
  144.                     int npts);
  145.  
  146. /*
  147.  * greyscale/color 2D plot for the NeXT
  148.  */
  149. void drawColor2D_XIV(int nXBins,
  150.                      int nYBins,
  151.                      float minBin,
  152.                      float maxBin,
  153.                      float bins[]);
  154.  
  155. /*
  156.  * 3D histogram.  So far unimplemented.
  157.  */
  158. void drawLego2D_XIV(int nXBins,
  159.                    int nYBins,
  160.                    float minBin,
  161.                    float maxBin,
  162.                    float bins[]);
  163.                   
  164. #ifdef __cplusplus
  165. }
  166. #endif
  167.  
  168.  
  169. #endif
  170.  
  171.